﻿using Agile.Infra.WeiXin; 
using Microsoft.Extensions.Configuration;

namespace Microsoft.Extensions.DependencyInjection;

public static class ServiceCollectionExtension
{
    public static IServiceCollection AddWxApplet(this IServiceCollection services, IConfiguration section)
    {
        if (services.HasRegistered(nameof(AddWxApplet)))
            return services;

        services.Configure<AppletOptions>(section.GetSection("WxApplet"));
        services.AddTransient<IAppletService, AppletService>();
        return services;
    }
}
